package com.wg.net.operations;

import com.wg.core.io.BigEndianBinaryWriter;
import com.wg.core.io.IBinaryWriter;
import com.wg.core.io.IBinaryWritable;

public class PingResponse implements IBinaryWritable {
    private long clientTimeStamp;
    private long serverTimeStamp;

    public PingResponse(long clientTimeStamp, long serverTimeStamp) {
        this.clientTimeStamp = clientTimeStamp;
        this.serverTimeStamp = serverTimeStamp;
    }

    public long getClientTimeStamp() {
        return clientTimeStamp;
    }

    public void setClientTimeStamp(long clientTimeStamp) {
        this.clientTimeStamp = clientTimeStamp;
    }

    public long getServerTimeStamp() {
        return serverTimeStamp;
    }

    public void setServerTimeStamp(long serverTimeStamp) {
        this.serverTimeStamp = serverTimeStamp;
    }
    
    @Override
    public byte[] toBytes() {
        IBinaryWriter writer = new BigEndianBinaryWriter(32);
        writer.writeLong(clientTimeStamp);
        writer.writeLong(serverTimeStamp);
        return writer.toByteArray();
    }
}
